#include <iostream>
#include <unistd.h>
#include <time.h>

#include "LocalGuard.hpp"
#include "ThreadPool.hpp"
#include "LogMessage.hpp"
#include "Task.hpp"

std::string oper = "+-*/%*(#&)";

int main()
{
    srand((unsigned)time(nullptr));
    ThreadPool<Task>* tp = ThreadPool<Task>::GetInstance();
    tp->Start();
    int n = 30;
    while (n--)
    {
        int x = rand() % 100;
        usleep(123);
        int y = rand() % 100;
        usleep(123);
        char op = oper[rand() % oper.size()];
        Task ts(x, op, y);
        tp->Push(ts);

        sleep(1);
    }
    tp->Wait();

    delete tp;

    return 0;
}